<?php
/**
 * Created by JetBrains PhpStorm.
 * User: root
 * Date: 10/17/12
 * Time: 10:06 PM
 * To change this template use File | Settings | File Templates.
 */
class Exception_Base extends Exception
{
	// Redefine the exception so message isn't optional
	public function __construct($message, $code = 0, Exception $previous = NULL)
	{
		// make sure everything is assigned properly
		parent::__construct($message, $code, $previous);
	}

	public function __toString()
	{
		return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
	}

	public function errorMessage()
	{
		$errorMsg = 'Error on line '.$this->getLine().' in '.$this->getFile().': <b>'.$this->getMessage().'</b>';

		return $errorMsg;
	}
}
